package day03;

public class OperDemo {
    public static void main(String[] args) {










        /*
        int num=20;
        int flag=num>16?1:0;
        System.out.println(flag);

        //找两个数的最大值
        int a= 33,b=18 ;
        int max=a<b?b:a;
        System.out.println(max);



         */



        /*

        int age=8;
        System.out.println("我今年" + age+"岁了");

        String name="蔡徐坤";
        System.out.println("我的小鸡叫"+name+"，今年"+age+"岁了");
        //我的小鸡叫蔡徐坤，今年8岁了
        String hobby="唱、跳、rap、篮球";
        System.out.println("喜欢"+hobby);//喜欢唱、跳、rap、篮球

        //任何数据与字符串相连，都会转化成字符串
        System .out.println(""+5+10+15);//51015-----String
        System.out.println(5+10+""+15);//1515-------String
        System.out.println(5+10+15+"");//30---------String



         */



        /*
        int a=10;
        a+=8;
        System.out.println(a);//18
        a*=2;
        System.out.println(a);//36
        a/=9;
        System.out.println(a);//4
        a%=3;
        System.out.println(a);//1


        short b=5;
        //b=b+5;//参与运算时会转换成int型，编译错误，应改成b=(short)(b+5);
        b+=5;//拓展赋值会自动强制转换，相当于b=(short)(b+5);




         */






        /*

        int a=5,b=10,c=5;
        boolean a1=a<b||c++>3;
        System.out.println(c);//发生短路，不执行c++  5
        boolean a2=a>b||c++>3;
        System.out.println(c);//6

        boolean a3=a>b&&c++>5;
        System.out.println(c);//发生短路，不执行c++  6
        boolean a4=a<b&&c++>5;
        System.out.println(c);//7



         */





        /*
        int a=1,b=2,c=3;
        boolean a1=!(a<b);
        System.out.println(a1);//!true false
        System.out.println(!(a+b>=c));//!true  false
        System.out.println(a*c>b||a+b<c);//true||false true
        System.out.println(!(a+c>=2*b));//!true false


         */





        /*
        int a=1,b=2,c=3;
        boolean a1=a>=b && a<c;
        System.out.println(a1);//false
        System.out.println(a==b||b<c);//true
        System.out.println(b!=a&&b>c);//false

        int score=25;

        System.out.println(score>=60&&score<=100);//false

        int age=24;
        System.out.println(age<=30&&age>=18);//true



         */









        /*

        int a=1,b=2,c=3;
        boolean a1=a>b;
        System.out.println(a1);//false
        System.out.println(a+b>=c);//true
        System.out.println(a*b<c);//true
        System.out.println(a==c-b);//true
        System.out.println(b!=c-a);//false

        System.out.println(a++>=b);//false a自增1为2
        System.out.println(++a>=b);//true  a自增1为3

        System.out.println(a++>=c);//true  a自增1为4
        System.out.println(a);//4




         */






        /*
        int a=5,b=5;
        a++;//只有a++才是单独使用
        System.out.println(a);//a+1=6
        int c=a++;//
        int d=++b;
        System.out.println(c);//6
        System.out.println(d);//6

        int a1=5,b1=5;
        System.out.println(a1++);//5，a1++被使用的数值为a1=5，a1自增
        System.out.println(a1);//6
        System.out.println(++b1);//6，++b1被使用的数值为b1+1=6，b1自增
        System.out.println(b1);//6


         */
    }
}
